package com.lijing.service;

import com.lijing.dao.ActivityDao;
import com.lijing.model.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "ActivityService")
public class ActivityServiceImpl implements ActivityService {

    @Autowired
    private ActivityDao activityDao;

    @Override
    public Activity getActivity(Integer aid) {
        return activityDao.getActivity(aid);
    }

    @Override
    public void updateActivity(Activity activity) {
        activityDao.updateActivity(activity);
    }

    @Override
    public void joinActivity(Integer aid, Integer uid) {
        activityDao.joinActivity(aid, uid);
    }

    @Override
    public List<Activity> selectActivityByClubWidthMember(Integer cid) {
        return activityDao.selectActivityByClubWidthMember(cid);
    }

    @Override
    public List<Activity> selectActivityByClubAuth(Integer cid, Integer minAuth, Integer maxAuth) {
        return activityDao.selectActivityByClubAuth(cid, minAuth, maxAuth);
    }

    @Override
    public List<Activity> selectActivityByDate(Integer uid, String earliest, String latest) {
        return activityDao.selectActivityByDate(uid, earliest, latest);
    }

    @Override
    public List<Activity> selectActivityByUser(Integer uid, String aname) {
        return activityDao.selectActivityByUser(uid, aname);
    }

    @Override
    public List<Activity> selectActivityByClub(Integer cid) {
        return activityDao.selectActivityByClub(cid);
    }

    @Override
    public void exitActivity(Integer aid, Integer uid) {
        activityDao.exitActivity(aid, uid);
    }

    @Override
    public Boolean isJoin(Integer aid, Integer uid) {
        return activityDao.isJoin(aid, uid);
    }

    @Override
    public Integer getMemberCount(Activity activity) {
        return activityDao.getMemberCount(activity);
    }

    @Override
    public void deleteActivity(Integer aid) {
        activityDao.deleteActivity(aid);
    }

    @Override
    public void addActivity(Activity activity) {
        activityDao.addActivity(activity);
    }

    @Override
    public List<Activity> selectActivityByAuth(Integer minAuth, Integer maxAuth) {
        return activityDao.selectActivityByAuth(minAuth, maxAuth);
    }
}
